/*******************************************************************************
* 
* LibraryLoader for 3 different ways
* 
* 
******************************************************************************/
#pragma once
#include "noria.h"
#include "resource-manager.h"

using noria::io::ResourceManager;

namespace noria{ namespace engine
{      
    class LibraryLoader
    {
    public:
        LibraryLoader(void);
        virtual ~LibraryLoader(void);

        virtual pointer getProcAddr(const wchar_t* lib, const char* func) = 0;
        virtual pointer createComObject(const wchar_t* lib, const _GUID& clsid, const _GUID& iid) = 0;
    };

    class ComLoader : public LibraryLoader
    {
    public:
        ComLoader(void);
        virtual ~ComLoader(void);

        virtual pointer getProcAddr(const wchar_t* lib, const char* func);
        virtual pointer createComObject(const wchar_t* lib, const _GUID& clsid, const _GUID& iid);
    };

    class IsolatedLoader : public LibraryLoader
    {
    public:
        IsolatedLoader(void);
        virtual ~IsolatedLoader(void);

        virtual pointer getProcAddr(const wchar_t* lib, const char* func);
        virtual pointer createComObject(const wchar_t* lib, const _GUID& clsid, const _GUID& iid);
    };

    class MemoryLoader : public LibraryLoader
    {
    public:
        MemoryLoader(ResourceManager* res);
        virtual ~MemoryLoader(void);
 
        virtual pointer getProcAddr(const wchar_t* lib, const char* func);
        virtual pointer createComObject(const wchar_t* lib, const _GUID& clsid, const _GUID& iid);

    private:
        ResourceManager* m_res;
   };


}}